// https://www.acwing.com/problem/content/794/

#include <iostream>
#include <vector>

using namespace std;

const int MAX_N = 100'001;

int nums1[MAX_N];
int nums2[MAX_N];

void solution(int max_length) {
    for (int i=0; i<max_length+1; i++) {
        nums1[i] -= nums2[i];
        if (nums1[i] < 0) {
            nums1[i] += 10;
            nums1[i+1]--;
        }
    }
    bool flag = false;
    for (int i=max_length-1; i >= 0; i--) {
        if (nums1[i] > 0) {
            flag = true;
        }
        if (flag) {
            cout<<nums1[i];
        }
    }
    if (!flag) {
        cout<<"0";
    }
    cout<<endl;
}


int main() {
    string str1, str2;
    cin>>str1>>str2;

    bool larger = true;
    if (str1.length() < str2.length()) {
        larger= false;
    } else if (str1.length() == str2.length()) {
        for (int i=0; i<str1.length(); i++) {
            if (str1[i] < str2[i]) {
                larger = false;
                break;
            } else if (str1[i] > str2[i]) {
                larger = true;
                break;
            }
        }
    }
    if (!larger) {
        swap(str1, str2);
    }

    int t1=0;
    for (int i=str1.length()-1; i>=0; i--) {
        nums1[t1++] = str1[i] - '0';
    }

    int t2=0;
    for (int i=str2.length()-1; i>=0; i--) {
        nums2[t2++] = str2[i] - '0';
    }

    if (!larger) {
        cout<<"-";
    }

    solution(str1.length());

    return 0;
}
